package com.bw.unit3.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.bw.unit3.base.BaseBean
import com.bw.unit3.base.BaseViewModel
import com.bw.unit3.bean.BannerBean
import com.bw.unit3.bean.TypeBean
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch

/**
 *
 * @ClassName: TypeViewModel
 * @Description: java类作用描述
 * @Author: zhangyanchao
 * @CreateDate: 2024/9/21 10:59 AM
 * @Version: 1.0
 */
class TypeViewModel : BaseViewModel() {

    val typeLiveData = MutableLiveData<BaseBean<List<TypeBean>>>()

    fun getTypeGoods() {
        viewModelScope.launch(Dispatchers.IO) {
            typeLiveData.postValue(apiService.getTypeGoods())
        }
    }
}